using System.Globalization;
using System.Windows.Data;

namespace NavigateExample.Views
{
    /// <summary>
    /// 布尔值到关闭状态文本的转换器
    /// </summary>
    public class BoolToCloseStatusConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is bool allowClose)
            {
                return allowClose ? "允许关闭" : "禁止关闭";
            }
            return "未知状态";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException("不支持反向转换");
        }
    }
}